#include<stdio.h>
#define N 2
struct student
{
	int num;
	char name[10];
	int course1;
	int course2;
	int course3;
	int total;
};     //定义结构体类型
void main()
{
	struct student st[N];     //定义结构体变量
	int i, max, maxi;
	float average1 = 0,average2 = 0,average3 = 0;
	for(i = 0; i < N; i++)
	{
		scanf("%d",&st[i].num);
		scanf("%d",&st[i].course1);
		average1 = average1 + st[i].course1;
		scanf("%d",&st[i].course2);
		average2 = average2 + st[i].course2;
		scanf("%d",&st[i].course3);
		average3 = average3 + st[i].course3;
		scanf("%s",st[i].name);
	    st[i].total = st[i].course1 + st[i].course2 + st[i].course3;     //求出当前学生的总分
	}
	average1 = average1 / N;
	average2 = average2 / N;
	average3 = average3 / N;     //求出各科平均分
	max = st[0].total;
	for(i = 1; i < N; i++)
		if(st[i].total >= max)
		{
			max = st[i].total;
			maxi = i;
		}
	printf("三门课的平均成绩:\n");
	printf("%.2f %.2f %.2f\n",average1,average2,average3);
	printf("总分最高的学生:\n");
	printf("学号   姓名   课程1   课程2   课程3  总分\n");
	printf("%d %s %d %d %d %d\n" , st[maxi].num , st[maxi].name , st[maxi].course1 , st[maxi].course2 , st[maxi].course3 , st[maxi].total);
}
